<?
 session_start();
 require("connect.php");
 require("checksessionsolienlac.php"); 
 $chon = $_REQUEST["option"];
	if ($_REQUEST["option"]==Xoa)
	mysql_query("delete from solienlac where masll='{$_REQUEST["masll"]}'");	
?>
<html><!-- InstanceBegin template="/Templates/solienlactemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript" src="scripts/innovaeditor.js"></script>
<link rel="stylesheet" type="text/css" href="css/engine.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
</script>
</head>
<body>
<table align="center" width="938" cellpadding="0" cellspacing="0" border="0">
	<tr><td colspan="3" height="26" bgcolor="#CCCCCC">		
	<? $malop=$_REQUEST["mal"];
	$resu99=mysql_query("select * from lop where mal='{$malop}'");
		$row99=mysql_fetch_array($resu99);
	?>	
	<!--Menu 1-->
	<div id="tool">

	<a href="index.php">Trang chủ trường</a>
		 | 
		  <a href="hotrohoctap.php">Hỗ trợ học tập</a>
		  |				 
		<a href="lienhe.php">Liên hệ</a>
	</div>
	<!--het menu 1-->
	</td></tr>
	<tr><td colspan="3" height="34" bgcolor="#CCCCCC">	
	<div id="menuwrapper">
		<ul id="p7menubar">
			 <li><a class="trigger" href="lopcuatoi.php?mal=<? echo $malop;?>" target="_self">Trang chủ <? echo $row99["tenl"];?></a></li>			 						  	
		  <li class="linemenus"></li>					 
		  <li>
		  <?
		  	if ($_SESSION["login"]!=true){
		  ?>		  
		  <a class="trigger" href="login.php" target="_self">Trang cá nhân</a>
		  <? } else {
		  		if($_SESSION["quyen"]==0) {
		  ?>	
		   			<a class="trigger" href="admin/index.php" target="_self">Trang cá nhân</a>
		  		<? } else if($_SESSION["quyen"]==1) {?>
					<a class="trigger" href="giaovien.php?magv=<? echo $_SESSION["username"];?>" target="_self">Trang cá nhân</a>
				<? } else if($_SESSION["quyen"]==2) {?>
					<a class="trigger" href="trangphuhuynh.php?maph=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? } else if(($_SESSION["quyen"]==3) || ($_SESSION["quyen"]==4)) {?>
					<a class="trigger" href="tranghocsinh.php?mahs=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? }?>
		  		
		  <? }?>
		  <!--bat dau phan dang nhap-->
		  <?
				if ($_SESSION["login"]!=true){
			?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="login.php" target="_self">Đăng nhập</a>			
			<? }else{?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="logout.php" target="_self">Thoát</a>			
			 <li class="linemenus"></li>
			 <li><a class="trigger">
			 	<?
		$nguoidung=$_SESSION["username"];
		if($_SESSION["quyen"]==0){
		$resu23=mysql_query("select * from admin where maadmin='{$nguoidung}'");
		$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==1){
			$resu23=mysql_query("select * from giaovien where magv='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==2){
			$resu23=mysql_query("select * from phuhuynh where maph='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["tenph"]; ?>
			</font>
		<? }else if(($_SESSION["quyen"]==3)||($_SESSION["quyen"]==4)){
				$resu23=mysql_query("select * from hocsinh where mahs='{$nguoidung}'");
				$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }
	}?>
		  <!--het-->		 
		</ul>
	</div>	
	</td></tr>
	<tr>
		<td width="160px" height="800" valign="top">		
		<!--menu trai-->
		<table align="center" width="100%" border="1" cellpadding="0" cellspacing="0">
		<tr><td valign="middle" height="30">
			<a href="sodaubai.php?mal=<? echo $malop;?>"><img src="anh/sodaubai.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="sodaubai.php?mal=<? echo $malop;?>">Sổ đầu bài</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="danhsachhocsinh.php?mal=<? echo $malop;?>"><img src="anh/user.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="danhsachhocsinh.php?mal=<? echo $malop;?>">Danh sách học sinh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thuvienanhlop.php?mal=<? echo $malop;?>.php"><img src="anh/album.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thuvienanhlop.php?mal=<? echo $malop;?>">Thư viện ảnh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>"><img src="anh/baiviet.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>">Bài viết</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thoikhoabieu.php?mal=<? echo $malop;?>"><img src="anh/thoikhoabieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thoikhoabieu.php?mal=<? echo $malop;?>">Thời khóa biểu</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thongbaolop.php?mal=<? echo $malop;?>"><img src="anh/thongbao.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thongbaolop.php?mal=<? echo $malop;?>">Thông báo</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="tailieulop.php?mal=<? echo $malop;?>""><img src="anh/tailieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tailieulop.php?mal=<? echo $malop;?>">Tài liệu Upload</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="xemdiemlop.php?mal=<? echo $malop;?>""><img src="anh/xemdiem.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="xemdiemlop.php?mal=<? echo $malop;?>">Xem điểm</a>
		</td></tr>				
		</table>
		<!-- het menu trai-->
		</td>
		
    <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->
	<?
		$mahs=$_REQUEST["mahs"];
		$mal=$_REQUEST["mal"];
		$result=mysql_query("select * from hocsinh where mahs='{$mahs}'");
		$r=mysql_fetch_array($result);		
	?>
	<table align="center" cellpadding="1" cellspacing="1" border="0" width="99%">	
	<tr><td align="center">	
				<!--Begin tieu de-->
				<div class="gift_box_quatang">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="gift_quatang_infoblog">					
							<h1></h1>
							<font size="+2" color="#003366">
							<? 
							$result6=mysql_query("select * from lop where mal='{$mal}'");
							$r6=mysql_fetch_array($result6);
							?>
								Sổ liên lạc học sinh <? echo $r["hotendem"];echo "&nbsp;";echo $r["ten"];?> lớp <? echo $r6["tenl"];?>
							</font>		
						<div class="gift_quatang_mView">
							<span style="float:left; width:120px;">
							<b><a href="thongtinhocsinh.php?mahs=<? echo $mahs;?>$mal=<? echo $mal;?>">Thông tin học sinh</a></b>
							</span>
							<span style=" float: right;">															
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>
			

				</div>
				<!--End tieu de-->
				<!--Begin them nhan xet-->
				<div class="gift_box_quatang">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="gift_quatang_infoblog">
						<h1 align="left">							
								<font color="#CC3333">Thêm mới nhận xét</font>							
						</h1>																											
							<div class="noidungnhanxet">
							<!--noi dung-->
						<form name="f" action="themnhanxet_action.php?mahs=<? echo $mahs ?>&mal=<? echo $mal;?>" method="post">
							<table align="center" cellspacing="5" cellpadding="0" border="0" width="535px">
							<tr>
								<td rowspan="3" valign="top"><?
									$magv=$_SESSION["username"];
									$result8=mysql_query("select * from giaovien where magv='$magv'");
									$r8=mysql_fetch_array($result8)
								?>
								<div class="tieudiem" style="width:65px; height:60px; text-align:center">
									<div style=" border:1px solid #EEEEEE; padding:5px;">
									<img src="thumb.php?h=55&w=60&url=anhgiaovien/<? echo $r8["anh"];?>"/>
									</div>
								</div>
								</td>
								<td class="tieude1" align="left" height="11px">
								<input type="hidden" name="gvid" value="<? echo $magv?>">
								Giáo viên <? echo $r8["hotendem"];echo "&nbsp;";echo $r8["ten"];?>
								</td>
							</tr>
							<tr><td>Nội dung</td></tr>
							<tr><td>
								<textarea name="nhanxet" cols="52" rows="4"></textarea>
							</td></tr>
							<tr>
								<td></td>
								<td align="left">Vào ngày 
								<? $ngay=date("d-m-Y");?>
                     			<input name="demol1" id="demo11" type="text" size="25" value="<? echo $ngay;?>">
								<a href="javascript:NewCal('demo11','ddmmyyyy')"><img src="anh/cal.gif" width="16" height="16" border="0" alt="Pick a date">
								</a>					
								</td>
							</tr>
							
							<tr> 
							<td></td>
							<td align="left">
								<input type="submit" name="Submit" value="Thêm" onclick="return kt();">&nbsp;
								<input type="reset" name="Submit2" value="Reset">&nbsp;
								<input type="button" name="back" value="Back" onclick="window.history.go(-1);">
							</td>
							<SCRIPT language="javascript">
        					function kt()
								{								
								if(f.nhanxet.value=="")
									{
										alert("Nhận xét không được để trống !");
										f.nhanxet.focus();
										return false;
									};
								if(f.demol1.value=="")
									{
										alert("Bạn chưa chọn ngày !");
										f.demol1.focus();
										return false;
									};
								}
							return true;
							</script>
							</tr> 							
							</table>	
							</form>						
							<!--end noi dung-->
							</div>																												                              
                	<div class="gift_quatang_mView">
							<span style="float:left;">
									
							</span>
					</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>
			

				</div>
				<!--End them nhan xet-->																								
				<!--Begin nhan xet giao vien-->
				<div class="gift_box_quatang">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="gift_quatang_infoblog">
						<h1 align="left">
							<a href="nhanxetgiaovien.php?mahs=<? echo $mahs;?>">
								<font color="#CC3333">Nhận xét của giáo viên</font>
							</a>
						</h1>
						<!-- <table align="center" cellspacing="0" border="1" width="98%">	-->	
								
						<?
							$result3=mysql_query("select * from solienlac where mahs='{$mahs}'");
							if(mysql_num_rows($result3)<=0)
							{
								echo "Chưa có nhận xét nào của giáo viên !";
							}else {
							$num_page1=ceil(mysql_num_rows($result3)/5);
							$page1 = $_REQUEST["page1"];
							if($page1 <= 0) $page1 = 1;
							if($page1 > $num_page1) $page1 = $num_page1;
							$a1 = ($page1 - 1)*5;
							$result4 = mysql_query("select * from solienlac where mahs='{$mahs}' order by ngay DESC limit {$a1},5");
							while($r4=mysql_fetch_array($result4)){							
						?>																		
							<div class="noidungnhanxet">
							<!--noi dung-->
							<table align="center" cellspacing="2" border="0" width="535px">
							<tr>
								<td rowspan="2"><?
									$result7=mysql_query("select * from giaovien where magv='{$r4["magv"]}'");
									$r7=mysql_fetch_array($result7)
								?>
								<div class="tieudiem" style="width:65px; height:60px; text-align:center">
									<div style=" border:1px solid #EEEEEE; padding:5px;">
									<img src="thumb.php?h=55&w=60&url=anhgiaovien/<? echo $r7["anh"];?>"/>
									</div>
								</div>
								</td>
								<td class="tieude1" align="left" height="11px">
								Giáo viên <? echo $r7["hotendem"];echo "&nbsp;";echo $r7["ten"];?>
								</td>
							</tr>
							<tr><td valign="top">
								<? echo $r4["nhanxet"];?>
							</td></tr>
							<tr>
								<td></td>
								<td align="left">Vào ngày <? echo $r4["ngay"];?>
								&nbsp;&nbsp;&nbsp;
								<?
								if(($_SESSION["quyen"]==1)&($_SESSION["username"]==$r4["magv"])) 
								{
								?>
									<a href="suanhanxetsolienlac.php?masll=<? echo $r4["masll"];?>" title="Sửa nhận xét">
									<img src="anh/sua.png" height="13" width="13" border="0">&nbsp;Sửa
									</a>
									&nbsp;
									<a href="?masll=<? echo $r4["masll"];?>&option=Xoa&mahs=<? echo $mahs;?>&mal=<? echo $mal;?>" title="Xóa nhận xét" onClick="return confirm('Bạn có chắc muốn xóa không ?');">									
									<img src="anh/xoa.png" height="13" width="13" border="0">&nbsp;Xóa
									</a>
								<?
								}
								if($_SESSION["quyen"]==2) {
								?>
									<a href="traloinhanxet.php?masll=<? echo $r4["masll"];?>" title="Gửi ý kiến">
									<img src="anh/comment.png" height="13" width="13" border="0">&nbsp;Gửi ý kiến
									</a>
								<?
								}
								?>
								</td>
							</tr>
							</table>							
							<!--end noi dung-->
							</div>
							<? }}?>	
													
					<!--	</table>	-->									                              
                	<div class="gift_quatang_mView">
							<span style="float:left;">
													<? 
								for($i1 = 1; $i1 <=$num_page1; $i1++)
									if ($i1==$page1)  echo "&nbsp;".$i1."&nbsp;";
									else echo "&nbsp;<a href=?page1={$i1}&mahs={$mahs}&mal={$mal}>&nbsp;{$i1}</a>&nbsp;";
								?>	  							
							</span>							
							<span style=" float: right;">											
							<?
							if($_SESSION["quyen"]==1) {
								?>
									<a href="themnhanxet.php?mahs=<? echo $mahs?>&mal=<? echo $mal;?>" title="Thêm nhận xét">
									<img src="anh/them.png" height="13" width="13" border="0">&nbsp;Thêm nhận xét
									</a>
								<?
								}?>
							</span>
					</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>
			

				</div>
				<!--End nhan xet giao vien-->
				
	</td></tr>
	</table>
	<!-- InstanceEndEditable --></td>
	<!--menu phai-->
	<td width="190" valign="top" align="center">
		<div class="panel">
			<div class="panel_header">Danh sách bạn bè</div>
			<table align="center" width="100%" cellpadding="1" cellpadding="1" border="0">
			<tr>
			<?
				$resu4=mysql_query("select * from hocsinh where mal='{$malop}' ORDER BY RAND() LIMIT 12");
				$j=0;
				while($row4=mysql_fetch_array($resu4)){
					$j++;					
			?>
				<td>
				<div style=" border:1px solid #EEEEEE; padding:2px;">
				<a href="tranghocsinh.php?mahs=<? echo $row4["mahs"];?>&mal=<? echo $mal;?>" title="<? echo $row4["hotendem"]."&nbsp;".$row4["ten"];?>">
					<img src="thumb.php?h=41&w=41&url=anhhocsinh/<? echo $row4["anh"];?>" border="0"/>
				</a>
				</div>
				</td>
				<? if($j==4){?>			
			</tr><tr>
				<? 
				$j=0;
				}?>
			<? }?>
			</table>
		</div>
	</td>
	</tr>
	<tr><td colspan="3" align="center" valign="middle" bgcolor="#999999" height="100">Phạm Đức Đóa - Khoa CNTT - Đại học Xây Dựng</td></tr>
</table>
</body>
<!-- InstanceEnd --></html>
